package day_240429.superkeyword;

public class Person {
    String id;
    String name;
    int age;

    public Person() {
        // 此时，如果把 Person 的空参构造器注释，会报错。
        // If the super class does not have a no-argument constructor,
        // you will get a compile-time error.
        System.out.println("父类中的空参构造器");
    }

    public Person(String id) {
        System.out.println("父类中参数是 String id 的构造器被调用了");
        this.id = id;
    }

    public Person(String id, String name) {
        System.out.println("父类中参数是 String id、String name 的构造器被调用了");
        this.id = id;
        this.name = name;
    }

    public Person(String id, int age, String name) {
        this.id = id;
        this.age = age;
        this.name = name;
    }
}